<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Simpla Admin | Sign In</title>
<link rel="stylesheet" href="{{ static_url('templates/resources/css/reset.css') }}" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ static_url('templates/resources/css/style.css') }}" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ static_url('templates/resources/css/invalid.css') }}" type="text/css" media="screen" />	
<script type="text/javascript" src="{{ static_url('templates/resources/scripts/jquery-1.3.2.min.js') }}"></script>
<script type="text/javascript" src="{{ static_url('templates/resources/scripts/simpla.jquery.configuration.js') }}"></script>
<script type="text/javascript" src="{{ static_url('templates/resources/scripts/facebox.js') }}"></script>
<script type="text/javascript" src="{{ static_url('templates/resources/scripts/jquery.wysiwyg.js') }}"></script>
<script>
function sub() {

    
        var username = $("#username").val();
        var passwd = $("#passwd").val();
     

        if(username==''){

        alert('用户名不能为空');
        return false;

        }

        if(passwd==''){

        alert('密码不能为空');
        return false;

        }

       /* if((passwd!='admin') || (username!='admin')){

        alert('用户名或密码错误');
        return false;

        }*/

        
         $.ajax({
		type: "POST",
		url: "/login",
        data : {
    username : username,
    passwd : passwd,
},
        dataType: "html", 
		success: function(msg){
        
	if(msg=='ok'){
           
              window.location.href="/";
       
        }else{
         alert('登录失败，用户名或者密码错误');
        }
         
								}
				});
        
        
        }
</script>
</head>
  
	<body id="login">
		
		<div id="login-wrapper" class="png_bg">
			<div id="login-top">
			
				<h1>Simpla Admin</h1>
				<!-- Logo (221px width) -->
				<img id="logo" src="{{ static_url('templates/resources/images/logo.png') }}" alt="Youku.com" />
			</div> <!-- End #logn-top -->
			
			<div id="login-content">
				
				<form action="index.html">
				
					
					
					<p>
						<label>Username</label>
						<input class="text-input" type="text" name="username" id="username" />
					</p>
					<div class="clear"></div>
					<p>
						<label>Password</label>
						<input class="text-input" type="password" name="passwd" id="passwd"  />
					</p>
					<div class="clear"></div>
					<p id="remember-password">
						<input type="checkbox" />Remember me
					</p>
					<div class="clear"></div>
					<p>
						<input class="button" type="button" value="Sign In" onclick="sub();" />
					</p>
					
				</form>
			</div> <!-- End #login-content -->
			
		</div> <!-- End #login-wrapper -->
  </body>
</html>
